package acm.浙大新生赛;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while (t-- > 0) {
            int n = sc.nextInt();
            int f1 = 2, f2 = 3, f3 = 0, ans = 0;
            while (f2 < n) {
                f3 = f1 + f2;
                f1 = f2;
                f2 = f3;
                ans++;
            }
            System.out.println(ans + 1);
        }
    }
}
